<script setup lang="ts">
import HmSon from "./HmSon.vue";
interface Person {
  name: string;
  age: number;
}

defineProps<Person>();
//const emit = defineEmits<{ (e: "my-evevt", name: string): void }>();
const emit2 = defineEmits<{ "my-evevt2": [age: number] }>();
</script>

<template>
  <h2>自定义组件标题</h2>
  <p>{{ name }}</p>
  <p>{{ age }}</p>
  <!-- <button @click="emit('my-evevt', '张三')">按钮</button> -->
  <button @click="emit2('my-evevt2', 18)">按钮</button>
  <HmSon />
</template>
